package acm.蓝桥20;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;

/**
 * https://www.dotcpp.com/oj/contest6446_problem1.html
 * 给定一个长度为 n 的数列 A1, A2, · · · , An 和一个非负整数 x，给定 m 次查询, 每次询问能否从某个区间 [l,r] 中选择两个数使得他们的异或等于 x 。
 * 思路：只有查询的线段树
 */
public class B异或和 {
	static int maxn = 100001;
	static Tree[] tree;
	static int[] src;
	static int n, m, x, tn;
	static PrintWriter pw=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

	public static void main(String[] args) {
		Reader sc = new Reader();
		n = sc.nextInt();
		m = sc.nextInt();
		x = sc.nextInt();
		src = new int[n + 1];
		tn = (int) Math.pow(2, 1 + Math.ceil(Math.log(n) / Math.log(2)));
		tree = new Tree[tn];
		for (int i = 1; i <= n; i++) {
			src[i] = sc.nextInt();
		}
		build(1, 1, n);
		while (m-- > 0) {
			int l = sc.nextInt();
			int r = sc.nextInt();
			boolean ok = query(1, l, r);
			pw.println(ok?"yes":"no");
		}
		pw.flush();
	}

	private static void build(int i, int l, int r) {
		tree[i] = new Tree(l, r);
		if (l == r) {
			tree[i].v = src[l];
		} else {
			int m = l + r >> 1;
			build(i << 1, l, m);
			build(i << 1 | 1, m + 1, r);
			pull(i);
		}
	}
	
	public static boolean checkOk(int l,int r) {
		for (int j = l; j < r; j++) {
			for (int k = j + 1; k <= r; k++) {
				if((src[j]^src[k])==x) {
					return true;
				}
			}
		}
		return false;
	}

	private static void pull(int i) {
		int l = i << 1;
		int r = l | 1;
		if (tree[l].isOk || tree[r].isOk) {
			tree[i].isOk = true;
		} else {
			tree[i].isOk=checkOk(tree[i].l,tree[i].r);
		}
	}
	
	public static boolean query(int i,int l,int r) {
		if(l<=tree[i].l&&tree[i].r<=r) {
			return tree[i].isOk;
		}
		int m=tree[i].l+tree[i].r>>1;
		boolean res=false;
		if(l<=m) {
			res=query(i<<1,l,r);
		}
		if(m<r&&(!res)) {
			res=query(i<<1|1,l,r);
		}
		if(res) return true;
		return checkOk(l,r);
	}

	static class Tree {
		int l, r;
		int v;
		boolean isOk;

		public Tree(int l, int r) {
			super();
			this.l = l;
			this.r = r;
		}
	}
	static class Reader {
        static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        static PrintWriter pw=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        public Reader(Object... o) {
        }

        public int nextInt() {
            try {
                in.nextToken();
            } catch (Exception ignored) {}
            return (int) in.nval;
        }
	}
}
